<!DOCTYPE html>
<html>
    <head>
        <title>simplegrid</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width">
        <link type="text/css" rel="stylesheet" href="../style/avalon.doc.css">
        <script src="../avalon.js"></script>
        <script src="../highlight/shCore.js"></script>
        <script>
            require(["simplegrid/avalon.simplegrid","textbox/avalon.textbox"], function() {
                function getData(n) {
                    var ret = []
                    for (var i = 0; i < n; i++) {
                        ret.push({
                            symbol: "<input ms-widget='textbox'>",
                            price: range(100, 200),
                            change: Math.random().toFixed(2) * (Math.random() > 0.5 ? 1 : -1)
                        })
                    }
                    return ret
                }
                function range(s, b) {
                    return s + Math.floor((b - s) * Math.random())
                }
                avalon.define("test", function(vm) {
                    vm.simplegrid = {
                        columns: ["symbol", "price", "change"],
                        data: getData(10)
                    }
                    vm.$skipArray = ["simplegrid"]
                })
                avalon.scan()
            })
        </script>
    </head>
    <body >
        <fieldset ms-controller="test">
            <legend>最简单的例子</legend>
            <div ms-widget="simplegrid" style="width:99%">

            </div>
        </fieldset>
    </body>
</html>